#include<stdio.h>
#include<stdlib.h>

int main()
{
    int matrix1[2][3];
    int matrix2[3][2];
    int result[2][2];

    while(scanf("%d %d %d", &matrix1[0][0], &matrix1[0][1], &matrix1[0][2]) != EOF)
    {
        for(int i = 1; i < 2; ++i)
        {
                for(int j = 0; j < 3; ++j)
                {
                        scanf("%d", &matrix1[i][j]);
                }                
        }
    
        for(int i = 0; i < 3; ++i)
        {
                for(int j = 0; j < 2; ++j)
                {
                        scanf("%d", &matrix2[i][j]);
                }                
        }
        
        for(int i = 0; i < 2; ++i)
        {
                for(int j = 0; j < 2; ++j)
                {
                        result[i][j] = 0;
                        for(int k = 0; k < 3; ++k)
                                result[i][j] += matrix1[i][k]*matrix2[k][j];
                }
        }
        
        for(int i = 0; i < 2; ++i)
        {
                for(int j = 0; j < 2; ++j)
                {
                        printf("%d ", result[i][j]);       
                }
                printf("\n");
        }
    }

    return 0;   
}

/* the solution does not really corresponds to the problems described. */